package xaj.scc.ast;

import java.util.LinkedList;
import java.util.List;

import polyglot.ast.TypeNode;
import polyglot.types.Flags;
import polyglot.util.CodeWriter;
import polyglot.util.Position;
import polyglot.util.TypedList;
import polyglot.visit.PrettyPrinter;
import abc.aspectj.extension.AJClassDecl_c;

public class SyntaxClassDecl_c extends AJClassDecl_c implements SyntaxClassDecl {

	public SyntaxClassDecl_c(Position pos, Flags flags, String name,
			TypeNode superClass, List interfaces, SyntaxClassBody body) {
		super(pos, flags, name, superClass, interfaces, body);
	}

	public SyntaxClassDecl_c(Position pos, Flags flags, String name,
			SyntaxClassBody body) {		
		this(pos, flags, name, null,
				new TypedList(new LinkedList(), TypeNode.class, false), body);
	}
	
	public String toString() {
		return flags.clearInterface().translate() + "syntaxclass " + name + " " + body;
	}

	public void prettyPrintHeader(CodeWriter w, PrettyPrinter tr) {
		w.write(flags.translate());
		w.write("syntaxclass ");
		w.write(name);
		w.write(" {");
	}
	
	@Override
	public void accept(Visitor v) {
		v.visitSyntaxClassDecl(this);
	}
	
}
